<template>
  <div id="app">
    <button @click="getStudents">获取学生信息</button>
    <hr/>
    <button @click="getCars">获取车辆信息</button>

  </div>

</template>

<script>
import axios from 'axios'
export default {

  name:'App',
  data() {
    return {
      msg:'你好啊玮玮'
    }
  },
  methods: {
    getStudents(){
      axios.get('http://localhost:8080/api/students').then(
        response => {
          console.log('请求成功',response.data);
        },
        error =>{
          console.log('请求失败',error.message);
        }
      )
    },
    getCars(){
      axios.get('http://localhost:8080/demo/cars').then(res=>{
        console.log('请求成功',res.data);
      },
      err=>{
        console.log('请求失败',error.message);
      })
    }
  },

}
</script>

<style>

</style>